---
title: "Built-In Caching"
slug: /features/caching
description: "Speed up workflows with built-in intelligent caching"
toc_max_heading_level: 2
---

One of Dagger's most powerful features is its speed, by virtue of its ability to cache data across workflow runs.

Dagger caches several types of data:

1. **Layers**: This refers to build instructions and the results of some API calls, such as those that modify files and directories.
2. **Volumes**: This refers to the contents of a Dagger filesystem volume and is persisted across Dagger Engine sessions.
2. **Function Calls**: This refers to the values returned by calling a function in a module. Execution of the function call may be skipped when there is a cached result for the function call.

## Layer caching

"Layers" are the step-wise instructions and arguments that go into building a container image, including the result of each step. As container images are built by Dagger, Dagger automatically caches the layer involved for future use.

When Dagger executes a function, it first checks if it already has the layers required by that function. If it does, these layers are automatically reused by Dagger if their inputs remain unchanged.

## Volume caching

Volume caching involves caching specific parts of the filesystem and reusing them on subsequent function calls if they are unchanged. This is especially useful when dealing with package managers such as `npm`, `maven`, `pip` and similar. Since these dependencies are usually locked to specific versions in the application's manifest, re-downloading them on every session is inefficient and time-consuming.

:::info
For these tools to cache properly, they need their own cache data (usually a directory) to be persisted between sessions. By using a cache volume for this data, Dagger can reuse the cached contents across workflow runs and reduce execution time.
:::

## Function Calls

More details may be found in the [Extending Dagger](../../extending/modules/function-caching.mdx) documentation. 
